package com.aclass.wang.c206;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import java.util.HashMap;
import java.util.Map;

public class Main8Activity extends AppCompatActivity {
    //定位与传感器入口
    Map<Integer, Class> mTestItems = new HashMap<>();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main8);

        mTestItems.put(R.id.btn_test7, Main6Activity.class);
        mTestItems.put(R.id.btn_test1, Main7Activity.class);
        mTestItems.put(R.id.btn_test2, Main10Activity.class);
        mTestItems.put(R.id.btn_test3, Main11Activity.class);

        Button startMain4Activity = (Button) findViewById(R.id.btn_test5);
        startMain4Activity.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(Main8Activity.this, Main4Activity.class);
                startActivity(intent);
            }
        });

        Button startMain5Activity = (Button) findViewById(R.id.btn_test6);
        startMain5Activity.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(Main8Activity.this, Main5Activity.class);
                startActivity(intent);
            }
        });
    }

    public void onClick(View view) {
        Class dst = mTestItems.get(view.getId());
        Intent intent = new Intent(this, dst);
        startActivity(intent);
    }
}
